using System;

namespace Flood.Log
{
	public class ShapeRemovedSquare : IChange
	{
		private readonly Action<Square> addSquareBack;
		private readonly Shape shape;
		private readonly Square square;

		public ShapeRemovedSquare(Shape shape, Action<Square> addSquareBack, Square square)
		{
			this.shape = shape;
			this.addSquareBack = addSquareBack;
			this.square = square;
		}

		#region IChange Members

		public Shape Shape
		{
			get { return shape; }
		}

		public void Undo()
		{
			addSquareBack(square);
		}

		#endregion
	}
}